<?php
/**
 * Created by PhpStorm.
 * User: root
 * Date: 10/15/14
 * Time: 8:13 AM
 */

namespace Backend\Modules\Video\Models;

use Common\Models\Videos\HomeVideo as BaseHomeVideo;

class HomeVideo extends BaseHomeVideo
{
    public function afterSave()
    {
        if ($this->id) {
            $viewCache = $this->getDI()->getViewCache();
            $viewCache->delete('block-home-category-id-' . $this->home_category_id);
        }
    }

    public function afterDelete()
    {
        if ($this->id) {
            $viewCache = $this->getDI()->getViewCache();
            $viewCache->delete('block-home-category-id-' . $this->home_category_id);
        }
    }
}